/**
  ******************************************************************************
  * @file    User/main.c 
  * @date    11-Dec-2017
  * @brief   Main program body
  ******************************************************************************
  */  

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"
#include "usart1_printf.h"
#include "systick_delay.h"
#include "i2c1_bus.h"
#include "i2c1_paj7620.h"
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
uint16_t gCode = 0;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
int main(void)
{
	Systick_Delay_Init();
	Usart1_Printf_Init();
	I2c1_Bus_Init();
	I2c1_Paj7620_Init();

	printf("OK\r\n");
	
	  /* Infinite loop */
	while (1)
	{
		if(Paj7620_GetInterrupt())
		{
			Paj7620_Action();
		}
		delay_ms(20);
	}
}

#ifdef  USE_FULL_ASSERT

/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t* file, uint32_t line)
{ 
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  while (1)
  {
  }
}
#endif
